package com.ai.controller;

import com.ai.model.ChatRequestFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hh
 * @since 2024/5/25
 */
@RestController
@RequestMapping("ai")
public class ChatController {

    @Autowired
    private ChatRequestFactory chatRequestFactory;

    @RequestMapping("chat")
    public String chat(String question) throws Exception {
        return chatRequestFactory.getChatRequest().chat(question);
    }

}
